package state;


import state.state.CandyMachine;

/**
 * @description: 状态模式 将状态和动作绑定在一起 状态对象化 根据当前状态实现相应动作
　* @author 周杨
　* @date 2019/6/5  16:50
**/
public class Main {
    public static void main(String[] args) {
        CandyMachine candyMachine = new CandyMachine(6);
        candyMachine.printState();
        candyMachine.insertCoin();
        candyMachine.printState();
        candyMachine.turnCrank();
        candyMachine.printState();
        candyMachine.insertCoin();
        candyMachine.printState();
        candyMachine.turnCrank();
        candyMachine.printState();
    }
}
